package com.todo.delicacy.iface.backend.request;

import com.todo.common.common.entity.CurrentStaff;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author zhangwenxiang
 * @date 2024/3/5 19:59
 * @description
 */
@Data
@Schema(title = "新增美食入参", description = "新增美食入参")
public class InsertFoodInfoReq {

private CurrentStaff _staff;

    /**
     * 饭店id
     */
    @Schema(title = "饭店id", description = "饭店id")
    private Long restaurantId;
    /**
     * 餐品名称
     */
    @Schema(title = "餐品名称", description = "餐品名称")
    private String name;
    /**
     * 餐品描述
     */
    @Schema(title = "餐品描述", description = "餐品描述")
    private String desc;
    /**
     * 餐品类型：小炒、火锅等
     * FoodTypeEnum
     */
    @Schema(title = "餐品类型", description = "餐品类型")
    private Integer foodType;

    /**
     * 配料、制作方式等
     */
    @Schema(title = "配料、制作方式等", description = "配料、制作方式等")
    private FoodBatching batching;
    /**
     * 推荐原因
     */
    @Schema(title = "推荐原因", description = "推荐原因")
    private String recommend;
    /**
     * 售价
     */
    @Schema(title = "售价", description = "售价")
    private BigDecimal price;
    /**
     * 主图
     */
    @Schema(title = "主图", description = "主图")
    private String mainImg;
    /**
     * 默认排序
     */
    @Schema(title = "默认排序", description = "默认排序")
    private Integer sort;
    /**
     * 图片列表
     */
    @Schema(title = "图片列表", description = "图片列表")
    private List<String> imgList;
    /**
     * 外部关联列表
     */
    @Schema(title = "外部关联列表", description = "外部关联列表")
    private List<OutSideRelation> outSideRelationList;

    public boolean baseCheck() {
        if (restaurantId == null || name == null || desc == null || foodType == null || recommend == null || mainImg == null) {
            return false;
        }
        return true;
    }

    @Data
    public static class OutSideRelation {
        /**
         * 关联平台
         */
        @Schema(title = "关联平台", description = "关联平台")
        private String relationPlatform;
        /**
         * 跳转url
         */
        @Schema(title = "跳转url", description = "跳转url")
        private String jumpUrl;
        /**
         * 探索推荐信息
         */
        @Schema(title = "探索推荐信息", description = "探索推荐信息")
        private String exploreRecommend;
    }

    @Data
    public static class FoodBatching {
        /**
         * 配料
         */
        @Schema(title = "配料", description = "配料")
        private String batching;
        /**
         * 制作方式
         */
        @Schema(title = "制作方式", description = "制作方式")
        private String makeWay;
    }
}
